﻿<%@ Page Language="C#" MasterPageFile="~/Admin/MasterPage.master" AutoEventWireup="true"
    CodeFile="ContentMailList.aspx.cs" Inherits="Admin_ContentMailList" %>

<%@ Register Assembly="Fetco.Framework" Namespace="FetCo.Web.UI.WebControls" TagPrefix="FetCo" %>
<%@ Register Assembly="ASPnetPagerV2_8" Namespace="ASPnetControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="titlePlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="menuPlaceHolder" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="contentPlaceHolder" runat="Server">
    <div style="padding: 12px 12px 12px 12px;">
        <div>
            <asp:Literal ID="lb_error" runat="server"></asp:Literal></div>
        <div id="div_Show" runat="server">
            <div class="addnewrow">
                <a href="ContentEmail.aspx">
                    <%=Utilitys.Dictionary["Addnewrow"] %>
                    | </a>
                <asp:LinkButton ID="btnDelete" runat="Server" CausesValidation="false" OnClientClick="javascript: return confirm('Bạn có chắc là muốn xóa dòng này?');"
                    OnClick="btnDelete_Click"><%=Utilitys.Dictionary["DeleteSeletedRows"]%></asp:LinkButton>
            </div>
            <div>
                <FetCo:Repeater ID="rpt_BannerList" runat="server" OnItemDataBound="rpt_BannerList_ItemDataBound">
                    <HeaderTemplate>
                        <table cellspacing="1" cellpadding="3" width="100%" bgcolor="#cccccc" border="0">
                            <thead>
                                <tr class="listtableheader">
                                    <th style="width: 5em;" class="listtableheader">
                                        <asp:Label ID="Literal1" runat="server"><%=Utilitys.Dictionary["No"] %></asp:Label></th>
                                    <th style="width: 100em; text-align: center" class="listtableheader">
                                        <asp:LinkButton ID="lbtnSort" ToolTip="Click here to sort this list" runat="Server"
                                            CommandArgument="sort" CommandName="sortTitle"><%=Utilitys.Dictionary["Title"] %></asp:LinkButton></th>
                                    <th style="width: 10em; text-align: left" class="listtableheader">
                                        <asp:LinkButton ID="LinkButton2" runat="Server" CommandArgument="sort" CommandName="sortOrder">Mã số</asp:LinkButton></th>
                                    <th style="width: 10em; text-align: left" class="listtableheader">
                                        <asp:LinkButton ID="LinkButton1" runat="Server" CommandArgument="sort" CommandName="sortOrder">Ngày tạo</asp:LinkButton></th>
                                    <th style="width: 5em; text-align: center" class="listtableheader">
                                        <asp:CheckBox ID="chkCheckAll" runat="server" onclick="CheckAll(this)" /></th>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td nowrap style="width: 5em; text-align: center;">
                                <asp:Literal ID="litNo" runat="server">1</asp:Literal>
                                <input id="hidBanner" runat="server" type="hidden" /></td>
                            <td align="left">
                                <a title="Click here to edit this document" href="ContentEmail.aspx?id=<%# Eval("PhotoId")%>">
                                    <%# Eval("Title_Vn")%>
                                   
                                </a>
                            </td>
                            <td align="center" style="padding-top: 10px; padding-left: 8px">
                                <asp:TextBox ID="txt_Order" runat="server" Width="25"></asp:TextBox>
                                <asp:RegularExpressionValidator ID="reg_Order" runat="server" ControlToValidate="txt_Order"
                                    ValidationExpression="^[0-9,.,#]+$">*</asp:RegularExpressionValidator>
                            </td>
                            <td align="left">
                                <asp:Literal ID="ltr_CreateDate" runat="server"></asp:Literal></td>
                            <td align="center">
                                <asp:CheckBox ID="chkBanner" runat="server" /></td>
                        </tr>
                    </ItemTemplate>
                </FetCo:Repeater>
            </div>
            <div style="padding-top: 12px;" align="center">
                <cc1:PagerV2_8 ID="hyperlinkPager" runat="server" CompactModePageCount="5" GenerateFirstLastSection="true"
                    OnCommand="pager_Command" GeneratePagerInfoSection="false" GenerateSmartShortCuts="false"
                    GenerateHiddenHyperlinks="false" NormalModePageCount="5" />
            </div>
        </div>
        <div style="padding-top: 12px;">
            <asp:Button ID="btn_Save" runat="server" Text="Save" OnClick="btnSave_Click" /></div>
    </div>

    <script type="text/javascript">
     function CheckAll(obj)
    {
        // find any item not check
        
        var countUncheck = 0;
        var checkAll = true;
        var checkList = document.getElementsByTagName("input");
            
		if(!obj.checked)
		    checkAll = false;
		for(var i = 0 ; i < checkList.length ; i++)
		{ 
			if(checkList[i].type == 'checkbox' && checkList[i].id.indexOf("chkBanner") >= 0 )
			{
				checkList[i].checked = checkAll;
			}
		}		
    }</script>

</asp:Content>
